void pixelar_c (
	unsigned char *src,
	unsigned char *dst,
	int m,
	int n,
	int src_row_size,
	int dst_row_size
) {
	for(int i = 0; i + 3 < m; i+=4)
	{
		for(int j = 0; j + 3 < n; j+=4)
		{
			unsigned char x00, x01, x02, x03;
			unsigned char x10, x11, x12, x13;
			unsigned char x20, x21, x22, x23;
			unsigned char x30, x31, x32, x33;

			unsigned int suma;
			unsigned short promedio;

			x00 = src[(i + 0) * src_row_size + j + 0];
			x01 = src[(i + 0) * src_row_size + j + 1];
			x02 = src[(i + 0) * src_row_size + j + 2];
			x03 = src[(i + 0) * src_row_size + j + 3];

			x10 = src[(i + 1) * src_row_size + j + 0];
			x11 = src[(i + 1) * src_row_size + j + 1];
			x12 = src[(i + 1) * src_row_size + j + 2];
			x13 = src[(i + 1) * src_row_size + j + 3];

			x20 = src[(i + 2) * src_row_size + j + 0];
			x21 = src[(i + 2) * src_row_size + j + 1];
			x22 = src[(i + 2) * src_row_size + j + 2];
			x23 = src[(i + 2) * src_row_size + j + 3];

			x30 = src[(i + 3) * src_row_size + j + 0];
			x31 = src[(i + 3) * src_row_size + j + 1];
			x32 = src[(i + 3) * src_row_size + j + 2];
			x33 = src[(i + 3) * src_row_size + j + 3];

			suma = x00 + x01 + x02 + x03 
					+ x10 + x11 + x12 + x13
					+ x20 + x21 + x22 + x23
					+ x30 + x31 + x32 + x33;
			promedio = suma / 16;

//			printf("%u : %hu,", promedio, suma);
			
			dst[(i + 0) * dst_row_size + j + 0] = promedio;
			dst[(i + 0) * dst_row_size + j + 1] = promedio;
			dst[(i + 0) * dst_row_size + j + 2] = promedio;
			dst[(i + 0) * dst_row_size + j + 3] = promedio;

			dst[(i + 1) * dst_row_size + j + 0] = promedio;
			dst[(i + 1) * dst_row_size + j + 1] = promedio;
			dst[(i + 1) * dst_row_size + j + 2] = promedio;
			dst[(i + 1) * dst_row_size + j + 3] = promedio;

			dst[(i + 2) * dst_row_size + j + 0] = promedio;
			dst[(i + 2) * dst_row_size + j + 1] = promedio;
			dst[(i + 2) * dst_row_size + j + 2] = promedio;
			dst[(i + 2) * dst_row_size + j + 3] = promedio;

			dst[(i + 3) * dst_row_size + j + 0] = promedio;
			dst[(i + 3) * dst_row_size + j + 1] = promedio;
			dst[(i + 3) * dst_row_size + j + 2] = promedio;
			dst[(i + 3) * dst_row_size + j + 3] = promedio;
		}
	}
}
